import { defHttp } from '@/utils/http/axios';

enum Api {
  FILE_DATA = '/fileData',
  GET_FILE = '/getFile',
  DOWNLOAD_FILE = '/downloadFile',
}

// Get personal center-basic settings
export const useFileDataApi = ({ userid }) =>
  defHttp.get<any>({ url: Api.FILE_DATA, params: { userid } });

export const useGetFileDataApi = ({ userid, filePath }) =>
  defHttp.post({ url: Api.GET_FILE, data: { userid, filePath } });

export const useDownloadFileApi = ({ filePath }) =>
  defHttp.get({ url: Api.DOWNLOAD_FILE, params: { filePath } }, { params: { filePath } });
